Subject: Re: Auto opening libraries by SAS/C
From: [email-masked] (Doug Walker)
Date: 18 Feb 93 14:20:00 GMT
Newsgroups: comp.sys.amiga.programmer

In article <[email-masked]>, [email-masked] (Bart Schraa) writes:
|> What I tried is this:
|> 
|> #include <stdio.h>
|> #include <proto/intuition.h>
|> 
|> long __oslibversion = 38L;
|> 
|> void main(void)
|> {
|>   printf("!\n");
|> }
|> 
|> As my version of the OS is 37, I assume it shouldn't print anything, or at least not a '!'. What am I doing wrong???
|> 

You didn't use IntuitionBase, so it didn't get linked in, so it
didn't get initialized.  Declaring it is not the same as using it.

You can use it either by calling any Intuition function (the normal
way) or by referring to it in code.

Try the code below.  Note that DisplayBeep is an Intuition function.

   #include <stdio.h>
   #include <proto/intuition.h>

   long __oslibversion = 38L;

   void main(void)
   {
      DisplayBeep(NULL);
   }

What I get is a line to stdout saying

   Can't open version 38 of "intuition.library"

and the DisplayBeep never happens.  Change __oslibversion to 37,
and the DisplayBeep will happen (your screen will flash).

-- 
  *****
=*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
 *|. o.| ||                                          1200/2400/9600 Dual
  | o  |//     For all you do, this bug's for you!
  ====== 
usenet: [email-masked]                            bix: djwalker 
Any opinions expressed are mine, not those of SAS Institute, Inc.